<?php
    $account_type  = C('Common.account_type');
    $active_status = C('Common.active_status');
    // 初始化值
    init_input_val(array('role_id','account_type','active_status','start_time','end_time','keyword'),$_data);
?>
<body>
<div class="wrap J_check_wrap">
    <div class="nav">
        <ul class="cc">
            <li class="current"><a href="<?php echo U('Admin/Member/index'); ?>">用户管理</a></li>
        </ul>
    </div>
    <div class="h_a">提示信息</div>
    <div class="mb10 prompt_text">
        <ol>
            <li>关键字检索对象包含登陆账号、昵称、绑定邮箱、绑定手机</li>
        </ol>
    </div>
    
    <div class="mb10"><a class="btn J_dialog" href="<?php echo U('Admin/Member/add'); ?>" title="添加用户" role="button"><span class="add"></span>添加用户</a></div>
    
    <div class="h_a">检索</div>
    <div class="search_type cc mb10">
        <form action="<?php echo U('Admin/Member/index'); ?>" method="post">
         <?php echo select('role_id',$roles,$_data['role_id'],'账号角色',array('class'=>'select_2')); ?>
         <?php echo select('account_type',$account_type,$_data['account_type'],'账号区分',array('class'=>'select_2 w90')); ?>
         <?php echo select('active_status',$active_status,$_data['active_status'],'账号状态',array('class'=>'select_2 w90')); ?>
         <label>注册日期：</label>
         <input type="text" name="start_time" class="input w100 J_datetime date" value="<?php echo $_data['start_time']; ?>">-
         <input type="text" name="end_time" class="input w100 J_datetime date" value="<?php echo $_data['end_time']; ?>">
         <label>关键字：</label>
         <input type="text" name="keyword" class="input w100" value="<?php echo $_data['keyword']; ?>">
         <button type="submit" class="btn">搜索</button>
        </form>
    </div>
    
    <form method="post" action="#" id="J_tag_form" class="J_ajaxForm">
    
    <div class="table_list">
        <table width="100%">
            <thead>
                <tr>
                    <td width="60"><label><input class="J_check_all" data-checklist="J_check_x" data-direction="x" type="checkbox">全选</label></td>
                    <td>登陆账号</td>
                    <td>账号区分</td>
                    <td>昵称</td>
                    <td>绑定邮箱</td>
                    <td>绑定手机</td>
                    <td>账号状态</td>
                    <td>注册日期</td>
                    <td>操作</td>
                </tr>
            </thead>
            <?php if(!empty($members)): ?>
            <tbody id="J_tag_list">
                <?php foreach($members as $member): ?>
                <tr>
                <td><input class="J_check" name="id[]" value="<?php echo $member['id']; ?>" data-xid="J_check_x" data-yid="J_check_y" type="checkbox"></td>
                <td><?php echo $member['account']; ?></td>
                <td><?php echo set_key_val($member['account_type'],$account_type); ?></td>
                <td><?php echo $member['nickname']; ?></td>
                <td><?php echo $member['email']; ?></td>
                <td><?php echo $member['mobile']; ?></td>
                <td><?php echo set_key_val($member['active_status'],$active_status); ?></td>
                <td><?php echo $member['created']; ?></td>
                <td>
                <a href="<?php echo U('Admin/Member/edit',array('uid'=>$member['id'])); ?>" title="用户编辑" class="mr5">[编辑]</a>
                </td>
                </tr>
                <?php endforeach; ?>
            </tbody>
            <?php endif; ?>
        </table>
        <div class="p10">
            <div class="pages">
                <?php echo $p; ?>
            </div>
        </div>
    </div>
    
    <div class="btn_wrap">
        <div class="btn_wrap_pd" id="J_sub_wrap">
            <label class="mr10"><input class="J_check_all" data-checklist="J_check_y" data-direction="y" type="checkbox">全选</label>
            <button class="btn J_ajax_submit_btn" data-subcheck="true" data-action="<?php echo U('Admin/Member/disable',array('state'=>2)); ?>" type="submit">禁止登陆</button>
            <button class="btn J_ajax_submit_btn" data-subcheck="true" data-action="<?php echo U('Admin/Member/disable',array('state'=>3)); ?>" type="submit">开启登陆</button>
            <button class="btn J_ajax_submit_btn" data-subcheck="true" data-msg="确定要删除吗?" data-action="<?php echo U('Admin/Member/delete'); ?>" type="submit">删除选中</button>
        </div>
    </div>
    
    </form>
</div>

</body>